﻿<phone:PhoneApplicationPage
    x:Class="TravisCI.BuildPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="{Binding Number}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <Rectangle Height="32" VerticalAlignment="Top" Grid.Row="1" Grid.ColumnSpan="2">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{Binding ResultColor}"/>
                </Rectangle.Fill>
            </Rectangle>
            <TextBlock Text="Commit: " Grid.Row="2"/>
            <TextBlock Text="{Binding Commit}" Grid.Row="2" Grid.Column="1"/>
            <TextBlock Text="Author(s): " Grid.Row="3"/>
            <TextBlock Text="{Binding Author}" Grid.Row="3" Grid.Column="1"/>
            <TextBlock Text="Branch: " Grid.Row="4"/>
            <TextBlock Text="{Binding Branch}" Grid.Row="4" Grid.Column="1"/>
            <TextBlock Text="Url: " Grid.Row="5"/>
            <HyperlinkButton TargetName="_blank" Content="Compare URL" NavigateUri="{Binding Url}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" FontSize="{StaticResource PhoneFontSizeNormal}"/>
            <TextBlock Text="Date: " Grid.Row="6"/>
            <TextBlock Text="{Binding Date}" Grid.Row="6" Grid.Column="1"/>
            <TextBlock Text="Build Duration: " Grid.Row="7"/>
            <TextBlock Text="{Binding BuildDuration}" Grid.Row="7" Grid.Column="1"/>
            <ListBox x:Name="JobListBox" ItemsSource="{Binding Jobs}" Grid.Row="8" Grid.ColumnSpan="2" SelectionChanged="SelectJob">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0,16,0,17" Width="Auto" Height="Auto">
                            <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Height="32" Width="32">
                                <Rectangle.Fill>
                                    <SolidColorBrush Color="{Binding ResultColor}"/>
                                </Rectangle.Fill>
                            </Rectangle>
                            <TextBlock Text="{Binding Id}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextNormalStyle}" Margin="48,-32,12,0"/>
                            <TextBlock Text="{Binding Env}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" Margin="48,-6,12,0"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True">
            <shell:ApplicationBar.Buttons>
                <shell:ApplicationBarIconButton Text="Refresh" IconUri="appbar.refresh.rest.png" Click="ApplicationBarRefresh_Click" />
            </shell:ApplicationBar.Buttons>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>